package com.singlemusic.dao;

import java.io.Serializable;
import java.util.List;

public interface BaseDao<T> {
	//add
	public boolean add(T t);
	
	//delete
	public boolean delete(T t);
	
	//search by id
	public T findByID(Class<T> c, Serializable id);
	
	//update
	public boolean update(T t);
	
	//merge
	public boolean merge(T t);
	
	//findAll
	public List<T> findAll(Class<T> c);
	
	//search by HQL
	public List<T> findByHql(String hql, String[] param);
	
	//search by SQL
	public List<T> findBySql(Class<T> c, String sql, String[] param);
	
	//counting result
	public int getResultCount(String hql, String[] param);
	
	//findByPage
	public List<T> findByPage(String hql, String[] param, int page, int row);
}
